It is often required to measure one or more chemical characteristics of a sample of a material in order to ensure that the material complies with certain standards and take appropriate steps when the material is non-compliant. For example, it is desired to test the PH and other characteristics of water in a fish tank or pool, and then take corrective action if the PH is not within tolerance. Many types of chemistry test kits are available commercially that enable a user to test the water sample, such as test strips or mixing kits in which a reagent is added to the water sample that will turn the sample a certain color based on the PH of the water. Prior art test kits require a user to compare the color of the mixed water sample to a pre-printed chart by eye, which leads to errors in interpretation. Other prior art systems have been proposed in which a smartphone or other similar handheld computing device will capture an image of the water sample and then automatically compare the color(s) of the captured image to a predefined standard. Problems arise in this situation since the color(s) of the captured image will vary based on various parameters including but not limited to lighting conditions, optical qualities of the camera lens, and the sensitivity of the camera sensor. To attempt to compensate for these variations, calibration methodologies have been proposed whereby a calibration profile is pre-computed for a specific device and applied at the time of computation. This manual or infrequent calibration introduces measurement error as it is highly likely that the profile will change from the time of computation. Additionally, these proposed prior art methods are insufficient for various reasons, such as requiring the user hold the camera a fixed distance from the water sample. Other deficiencies in the prior art exist in the spatial region identification, wherein prior art methods do not clearly address finding the location of the sample in space which is required for future processing.
The method and apparatus disclosed and claimed herein overcome the deficiencies in the prior art for measuring a chemical characteristic of a material, and in particular in measuring a chemical characteristic of a sample of the material such as water from a fish tank or a pool, by using a computing device such as a smartphone that captures an image of the material sample and calibrates the image to account for variations in lighting and the image sensor in the smartphone, and then calculates the chemical characteristic of the calibrated image for display to a user as well as further processing and analysis.